This invention relates to systems that process streaming disk I/O and non-streaming disk I/O and, in particular, to a system in which processing of streaming disk I/O is prioritized over processing of non-streaming disk I/O.
The advent of streaming input/output (I/O) technology has proven to be a major advancement in the development of computer technology for entertainment and multimedia products and services. Streaming technology is used, for instance, to provide full-motion video over the Internet or from another source. As the name indicates, streaming technology provides a stream of data from an input source such as a disk, video camera, computer file, etc., and renders that data to an output device, typically a video monitor. In most implementations, the input of the data stream is closely synchronized with the output of the data stream so that when a portion of the data stream is being input, another portion of the data stream is being output.
A concept related to streaming is xe2x80x9ctimeshifting.xe2x80x9d Timeshifting involves reading and writing audiovisual data to and from a data source in close to real time. A significant difference in timeshifting and simple streaming is that a portion of a data stream may be input even if another portion of the same data stream is not being output. For instance, a live broadcast may be input in an audiovisual data stream onto a hard disk drive. A viewer of the broadcast may receive audiovisual data output almost immediately after the audiovisual data is written to the disk. However, the viewer may choose to xe2x80x9cpausexe2x80x9d the live broadcast. In this case, the audiovisual data continues to be input onto the disk, but the output stream is momentarily interrupted. The amount of audiovisual data on the disk increases as the input continues while the output is paused. The viewer may then resume output of the audiovisual data stream to continue to view the xe2x80x9clivexe2x80x9d broadcast from the point where it was interrupted. The amount of data on the disk remains relatively static as long as the input and output occur contemporaneously. When the input stream is halted, the amount of audiovisual data on the disk decreases as the viewer continues to receive the output stream until the stream is terminated.
This technology is limited by the bandwidth of the disk to which the data is written and from which the data is read. As used herein with regard to a disk, the term xe2x80x9cbandwidthxe2x80x9d refers to the volume of data that can be written to the disk in a given amount of time. For example, a disk may have a bandwidth of 0.5 megabytes per 100 milliseconds. This means that during a 100 millisecond period, the disk can receive or transmit 0.5 megabytes of data.
Streaming of audiovisual data imposes significant bandwidth requirements on a processor and I/O subsystem of a computer system. A single timeshifting application can easily consume most of the capacity of the processor and I/O subsystem on currently available platforms. If the disk bandwidth is exceeded, the user will experience undesirable artifacts such as video frame dropping, audio glitches, etc. It is, therefore, very important to manage disk bandwidth to the greatest extent possible when processing streaming applications.
The disk bandwidth limitation becomes even more important when consideration is given to systems that run both streaming applications and stochastic, or non-streaming applications. A non-streaming application is a typical computer application, such as a word processor, that utilizes processor time, but does not do so in a time-critical manner. While non-streaming applications should be processed in a timely manner for user satisfaction, these types of applications can typically be deferred for a few hundred milliseconds or so without causing a noticeable difference to the viewer. This is not the case with streaming applications, wherein a one hundred millisecond delay can cause a problem that is noticeable by the user.
It is, therefore, desirable to ensure that streaming disk I/O is processed in a timely manner while still allowing for adequate processing of non-streaming disk I/O. This can be done in most instances by prioritizing processing of streaming disk I/O and deferring processing of non-streaming disk I/O. There is a means by which this can be done, theoretically, in present systems. That is to set a xe2x80x9chigh-priorityxe2x80x9d bit to allow faster access to the processor. However, many applications already utilize this bit and it has generally become somewhat overused. Therefore, simply setting this bit for streaming disk I/O operations will not provide the desired result.
Described herein are methods for priority queuing of streaming disk I/O over non-streaming disk I/O and/or disk throttling, and systems and computer programs for implementing the methods. Disk throttling involves dividing disk bandwidth into discrete time quanta. When disk throttling is utilized, streaming disk I/O is processed first in a first time quantum. If there is any bandwidth remaining in the first time quantum, non-streaming disk I/O is processed in that time quantum to the greatest degree possible. Any non-streaming disk I/O that remains to be processed is deferred to a subsequent time quantum.
Priority queuing for streaming disk I/O involves parsing disk I/O to determine if the disk I/O is streaming or non-streaming. If the disk I/O is streaming, it is processed ahead of the non-streaming I/O. There are several ways to determine which disk I/O is streaming and which is non-streaming.
One way to distinguish streaming disk I/O from non-streaming disk I/O is to divide the disk into two partitions. Streaming dataxe2x80x94or applications that utilize streaming dataxe2x80x94are stored in one partition. Non-streaming dataxe2x80x94or applications that utilize non-streaming dataxe2x80x94are stored in the other partition. The system can then ascertain which disk I/O is streaming disk 110 simply by determining to which partition the data is being written, or from which partition the data is being read.
Another way in which streaming disk I/O can be identified is to include a streaming flag in an application program interface through which an application communicates with a system. If the application utilizes streaming disk I/O, then the application sets the streaming flag. The system recognizes the streaming flag when it is set and considers all disk I/O received and transmitted to that application as streaming disk I/O. The disk I/O is thus given a higher priority than non-streaming disk I/O. In a related manner, an application can inform a system on which it is to run that it utilizes streaming disk I/O. This can be done without the use of a flag in an application program interface. The system can thereafter treat the disk I/O from this application as streaming and manage it accordingly.
The distinction between streaming disk I/O and non-streaming disk I/O can also be made with the use of an application lookup table. The application lookup table contains names of applications that utilize streaming disk I/O. When the application is started, the system refers to the application lookup table. If the name of the application is found in the application lookup table, the system gives disk I/O from that application higher priority than disk I/O from applications that only utilize non-streaming disk I/O.
The application lookup table can be provided with a system, built as the system executes applications, or both. If the application lookup table is provided with the system, there is no work for the system to do other than to refer to the table. The problem with this way of providing the application lookup table is, however, that new applications cannot be added to the application lookup table as the system ages.
If the application lookup table is constructed by the system, the system will initially refer to the application lookup table when starting an application. If the application name is not in the application lookup table, the system proceeds as if the application utilizes only non-streaming disk I/O. If, however, the system finds that the application does, in reality, utilize streaming disk I/O, the system adds the name of the application to the application lookup table. Hence, the next time the application is run, the system will provide its required disk bandwidth at a high priority.
If a combination of these methods is used, an application lookup table is initially provided with the system. If the name of the application is not found in the application lookup table, but the application utilizes streaming disk I/O, the system will add the name of the application to the application lookup table. This initially provides a more complete application lookup table for the system, but it is dynamic and can grow and add applications as the system ages.
A final way discussed herein to distinguish between streaming disk I/O and non-streaming disk I/O is to add a streaming flag to any file that utilizes streaming disk I/O. When the system prepares to process a file, it will provide high priority processing for the disk I/O of that file if the streaming flag is set for that file. This method is more exact than treating the disk I/O of an entire application as streaming if any streaming disk I/O is utilized by that application. However, this requires a deeper change to most systems which may be prohibitive in view of the other methods discussed herein.
These methods and systems implementing these methods are described in more detail below.